package com.dq.Week1.day03.homeWork;
import java.util.Scanner;
public class GDBHDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("请输入大于6的偶数：");
       while(true)
       {
           int num = scanner.nextInt();
           if(num>6 && num%2==0)
           {
               for (int i = 2; i <= num / 2; i++) //循环判断 1不是质数排除1，从2开始循环到偶数的一半
               {
                   if (isZS(i, true) && isZS((num - i), true)) //开始通过方法判断 是否是质数
                   {
                       System.out.println(i + " " + (num - i));
                   }
               }


           }else
           {
               System.out.println("输入有误，重新输入");
           }
       }
    }

    public static boolean isZS(int num, boolean b) {
        for (int i = 2; i < num; i++) //不加等号 i等于num就跳出循环 返回true
        {
            if (num % i == 0)//挨个判断i是否能被其他数整除
            {
                b = false; //若满足条件，修改布尔值
                break;//退出循环
            }
        }
        return b;
    }
}